package com.atguigu.day07;

public class Test04 {
    public static void main(String[] args) {
        MyDate01 m1 = new MyDate01();
        m1.set(2021, 4, 6);
        m1.isLeapYear();
    }
}

class MyDate01 {
    int year, month, day;

    boolean isLeapYear() {
        if (this.year % 4 == 0 && this.year % 100 != 0 || this.year % 400 == 0) {
            System.out.println("当前日期是闰年");
            return true;
        } else {
            System.out.println("当前日期不是闰年");
            return false;
        }
    }

    void set(int y, int m, int d) {
        this.year = y;
        this.month = m;
        this.day = d;
    }

    void plus(int years, int months, int days) {

    }
}

